{include file="public/com_header"}

<body style="padding:10px;">
<div class="tplay-body-div">
        <form id="hashidsStrForm" class="layui-form">
            <div class="layui-form-item">
                <fieldset class="layui-elem-field layui-field-title layui-elem-field-id" style="margin-top: 30px;">
                    <legend>图片上传</legend>
                </fieldset>
                <div class="layui-upload-drag layui-upload-drag-id" id="image_upload">
                    <i class="layui-icon"></i>
                    <p>点击上传或将文件拖拽此处</p>
                </div>
                <blockquote class="layui-elem-quote layui-quote-nm layui-elem-quote-id" style="margin-top: 10px;">
                    预览图：
                    <div class="layui-upload-list" id="images_all">
                        <!--<label class="layui-form-label"></label>-->
                        <!--<img class="layui-upload-img" id="image-src" width="150" height="150" src="">-->
                        <!--<p id="demoText"></p>-->
                    </div>
                </blockquote>
            </div>
        </form>
    <script>
        layui.use(['layer', 'form','upload'], function() {
            var layer = layui.layer,
                $ = layui.jquery,
                upload = layui.upload,
                form = layui.form;
            $(window).on('load', function() {
                upload.render({
                    elem : '#image_upload'
                    ,url: "{:url('admin/Tools/uploadImage')}"
                    ,multiple: true
                    ,field:'image'
                    ,done: function(res){
                        var domain = document.domain;  //获取当前域名
                        var image_url =domain+res.data;
                        var  htmlStr ='<img  class="layui-upload-img" src="'+'http://'+ image_url +'"> <label><a href="javascript:;" onclick=""  style="color:blue;font-size:24px;">' + "删除" + '</a></label>';
                        $('#images_all').append(htmlStr)
                        // $('#image-src').src = image_url;
                        // document.getElementById('image-src').src.src = image_url;
                    }

                });
            });
        });
    </script>




</div>
</body>
</html>
